python_code stringlengths 0 4.04M | repo_name stringlengths 7 58 | file_path stringlengths 5 147 |
|---|---|---|
"""
download pretrained weights to ./weights
wget https://dl.fbaipublicfiles.com/dino/dino_vitbase8_pretrain/dino_vitbase8_pretrain.pth
wget https://dl.fbaipublicfiles.com/dino/dino_deitsmall8_300ep_pretrain/dino_deitsmall8_300ep_pretrain.pth
"""
import sys
sys.path.append("maskcut")
import numpy as np
import PIL.Ima... | CutLER-main | maskcut/predict.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
"""
A script to run multinode training with submitit.
"""
import sys
sys.path.append('./')
sys.path.append('./MaskCut')
sys.path.append('./third_party')
import argparse
import os
import uuid
from pathlib import Path
import maskcut_with_submitit as main_func
impor... | CutLER-main | maskcut/run_with_submitit_maskcut_array.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# merge all ImageNet annotation files as a single one.
import os
import json
import argparse
if __name__ == "__main__":
# load model arguments
parser = argparse.ArgumentParser(description='Merge json files')
parser.add_argument('--base-dir', type=str,
... | CutLER-main | maskcut/merge_jsons.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
import os
import sys
sys.path.append('../')
import argparse
import numpy as np
from tqdm import tqdm
import re
import datetime
import PIL
import PIL.Image as Image
import torch
import torch.nn.functional as F
from torchvision import transforms... | CutLER-main | maskcut/maskcut.py |
# Copyright (c) Meta Platforms, Inc. and affiliates.
"""
Copied from Dino repo. https://github.com/facebookresearch/dino
Mostly copy-paste from timm library.
https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py
"""
import math
from functools import partial
import torch
impor... | CutLER-main | maskcut/dino.py |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
import os
import sys
sys.path.append('../')
import argparse
import numpy as np
import PIL.Image as Image
import torch
from torchvision import transforms
from scipy import ndimage
from detectron2.utils.colormap import random_color
import dino ... | CutLER-main | maskcut/demo.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from distutils.util import convert_path
from shutil import rmtree
from setuptools import Command, find_packages, setup
main_ns = {}
ver_path... | manifest-main | setup.py |
"""Web application for Manifest."""
| manifest-main | web_app/__init__.py |
"""Pydantic models."""
from typing import List, Optional, Union
from pydantic import BaseModel
class ManifestCreate(BaseModel):
"""Create manifest Pydantic."""
# Prompt params
prompt: str
n: int = 1
max_tokens: int = 132
temperature: Optional[float] = None
top_k: Optional[int] = None
... | manifest-main | web_app/schemas.py |
"""Manifest as an app service."""
from typing import Any, Dict, cast
from fastapi import APIRouter, FastAPI, HTTPException
from manifest import Manifest
from manifest.response import Response as ManifestResponse
from web_app import schemas
app = FastAPI()
api_router = APIRouter()
@app.get("/")
async def root() ->... | manifest-main | web_app/main.py |
__version__ = "0.1.9"
| manifest-main | manifest/version.py |
"""Manifest class."""
import asyncio
import copy
import logging
from typing import (
Any,
Dict,
Generator,
Iterator,
List,
Optional,
Tuple,
Type,
Union,
cast,
)
import numpy as np
from manifest.caches.noop import NoopCache
from manifest.caches.postgres import PostgresCache
from... | manifest-main | manifest/manifest.py |
"""Request object."""
from typing import Any, Dict, List, Optional, Tuple, Union
from pydantic import BaseModel
# Used when unioning requests after async connection pool
ENGINE_SEP = "::"
NOT_CACHE_KEYS = {"client_timeout", "batch_size"}
# The below should match those in Request.
DEFAULT_REQUEST_KEYS = {
"client_... | manifest-main | manifest/request.py |
"""Manifest init."""
from manifest.manifest import Manifest
from manifest.request import Request
from manifest.response import Response
__all__ = ["Manifest", "Response", "Request"]
| manifest-main | manifest/__init__.py |
"""Client response."""
import copy
import json
from typing import Any, Dict, Generator, List, Optional, Type, Union, cast
import numpy as np
from pydantic import BaseModel
from manifest.request import (
ENGINE_SEP,
DiffusionRequest,
EmbeddingRequest,
LMChatRequest,
LMRequest,
LMScoreRequest,
... | manifest-main | manifest/response.py |
"""OpenAI client."""
import copy
import logging
import os
from typing import Any, Dict, List, Optional
import numpy as np
import tiktoken
from manifest.clients.openai import OpenAIClient
from manifest.request import EmbeddingRequest
logger = logging.getLogger(__name__)
OPENAI_EMBEDDING_ENGINES = {
"text-embeddi... | manifest-main | manifest/clients/openai_embedding.py |
"""Azure client."""
import logging
import os
from typing import Any, Dict, Optional, Type
from manifest.clients.openai import OPENAI_ENGINES, OpenAIClient
from manifest.request import LMRequest, Request
logger = logging.getLogger(__name__)
# Azure deployment name can only use letters and numbers, no spaces. Hyphens ... | manifest-main | manifest/clients/azureopenai.py |
"""Hugging Face client."""
import logging
from functools import lru_cache
from typing import Any, Dict, Optional, Tuple
import numpy as np
import requests
from manifest.clients.client import Client
from manifest.request import EmbeddingRequest
logger = logging.getLogger(__name__)
class HuggingFaceEmbeddingClient(C... | manifest-main | manifest/clients/huggingface_embedding.py |
"""TOMA client."""
import base64
import io
import logging
from typing import Any, Dict
import numpy as np
from PIL import Image
from manifest.clients.toma import TOMAClient
from manifest.request import DiffusionRequest
logger = logging.getLogger(__name__)
# Engines are dynamically instantiated from API
# but a few ... | manifest-main | manifest/clients/toma_diffuser.py |
"""OpenAIChat client."""
import copy
import logging
import os
from typing import Any, Dict, Optional
from manifest.clients.openai import OpenAIClient
from manifest.request import LMRequest
logger = logging.getLogger(__name__)
# List from https://platform.openai.com/docs/models/model-endpoint-compatibility
OPENAICHAT... | manifest-main | manifest/clients/openai_chat.py |
"""TOMA client."""
import logging
import os
from datetime import datetime
from typing import Any, Dict, Optional
import requests
from manifest.clients.client import Client
from manifest.request import LMRequest
logger = logging.getLogger(__name__)
# Engines are dynamically instantiated from API
# but a few example ... | manifest-main | manifest/clients/toma.py |
"""Client class."""
import asyncio
import copy
import json
import logging
import math
from abc import ABC, abstractmethod
from typing import Any, Dict, Generator, List, Optional, Tuple, Union, cast
import aiohttp
import requests
import tqdm.asyncio
from tenacity import RetryCallState, retry, stop_after_attempt, wait_r... | manifest-main | manifest/clients/client.py |
"""Diffuser client."""
import logging
from functools import lru_cache
from typing import Any, Dict, Optional
import numpy as np
import requests
from manifest.clients.client import Client
from manifest.request import DiffusionRequest
logger = logging.getLogger(__name__)
class DiffuserClient(Client):
"""Diffuser... | manifest-main | manifest/clients/diffuser.py |
"""Client init."""
| manifest-main | manifest/clients/__init__.py |
"""Google client."""
import logging
import os
import subprocess
from typing import Any, Dict, Optional, Type
from manifest.clients.client import Client
from manifest.request import LMRequest, Request
logger = logging.getLogger(__name__)
# https://cloud.google.com/vertex-ai/docs/generative-ai/start/quickstarts/api-qu... | manifest-main | manifest/clients/google.py |
"""Google client."""
import copy
import logging
import os
from typing import Any, Dict, Optional, Type
from manifest.clients.google import GoogleClient, get_project_id
from manifest.request import LMRequest, Request
logger = logging.getLogger(__name__)
# https://cloud.google.com/vertex-ai/docs/generative-ai/start/qu... | manifest-main | manifest/clients/google_chat.py |
"""OpenAI client."""
import logging
import os
from typing import Any, Dict, List, Optional, Type
import tiktoken
from manifest.clients.client import Client
from manifest.request import LMRequest, Request
logger = logging.getLogger(__name__)
OPENAI_ENGINES = {
"text-davinci-003",
"text-davinci-002",
"tex... | manifest-main | manifest/clients/openai.py |
"""Azure client."""
import logging
import os
from typing import Any, Dict, Optional
from manifest.clients.openai_chat import OPENAICHAT_ENGINES, OpenAIChatClient
from manifest.request import LMRequest
logger = logging.getLogger(__name__)
# Azure deployment name can only use letters and numbers, no spaces. Hyphens ("... | manifest-main | manifest/clients/azureopenai_chat.py |
"""Hugging Face client."""
import logging
from functools import lru_cache
from typing import Any, Dict, Optional
import requests
from manifest.clients.client import Client
from manifest.request import DEFAULT_REQUEST_KEYS, LMRequest, LMScoreRequest
from manifest.response import LMModelChoice, ModelChoices, Response
... | manifest-main | manifest/clients/huggingface.py |
"""AI21 client."""
import logging
import os
from typing import Any, Dict, Optional
from manifest.clients.client import Client
from manifest.request import LMRequest
logger = logging.getLogger(__name__)
AI21_ENGINES = {
"j2-ultra",
"j2-mid",
"j2-light",
}
class AI21Client(Client):
"""AI21Client clie... | manifest-main | manifest/clients/ai21.py |
"""Cohere client."""
import logging
import os
from typing import Any, Dict, Optional
from manifest.clients.client import Client
from manifest.request import LMRequest
logger = logging.getLogger(__name__)
COHERE_MODELS = {"small", "medium", "large", "xlarge"}
class CohereClient(Client):
"""Cohere client."""
... | manifest-main | manifest/clients/cohere.py |
"""Dummy client."""
import hashlib
import logging
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
import tiktoken
from manifest.clients.client import Client
from manifest.request import LMChatRequest, LMRequest, LMScoreRequest, Request
from manifest.response import LMModelChoice, ModelChoices, ... | manifest-main | manifest/clients/dummy.py |
"""Client connection."""
import logging
import time
from typing import Any, Dict, List, Optional, Type
from pydantic import BaseModel, Extra
from manifest.clients.ai21 import AI21Client
from manifest.clients.azureopenai import AzureClient
from manifest.clients.azureopenai_chat import AzureChatClient
from manifest.cli... | manifest-main | manifest/connections/client_pool.py |
"""Connection init."""
| manifest-main | manifest/connections/__init__.py |
"""Request client schedulers.
Supports random selection and round robin selection.
"""
import numpy as np
class Scheduler:
"""Scheduler base class."""
NAME: str = "scheduler"
def __init__(self, num_clients: int):
"""Initialize scheduler."""
self.num_clients = num_clients
def get_cl... | manifest-main | manifest/connections/scheduler.py |
"""Api init."""
| manifest-main | manifest/api/__init__.py |
"""Response."""
import time
import uuid
from typing import Any, Dict, List
class ModelResponse:
"""ModelResponse."""
def __init__(self, results: List[Dict[str, Any]], response_type: str) -> None:
"""Initialize response."""
self.results = results
self.response_type = response_type
... | manifest-main | manifest/api/response.py |
"""Flask app."""
import argparse
import io
import json
import logging
import os
import socket
from typing import Dict
import pkg_resources
from flask import Flask, Response, request
from manifest.api.models.diffuser import DiffuserModel
from manifest.api.models.huggingface import (
MODEL_GENTYPE_REGISTRY,
Cro... | manifest-main | manifest/api/app.py |
"""Sentence transformer model."""
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
import torch
from sentence_transformers import SentenceTransformer
from manifest.api.models.model import Model
class SentenceTransformerModel(Model):
"""SentenceTransformer model."""
def __init__... | manifest-main | manifest/api/models/sentence_transformer.py |
"""Diffuser model."""
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
import torch
from diffusers import StableDiffusionPipeline
from manifest.api.models.model import Model
class DiffuserModel(Model):
"""Diffuser model."""
def __init__(
self,
... | manifest-main | manifest/api/models/diffuser.py |
"""Models init."""
| manifest-main | manifest/api/models/__init__.py |
"""Model class."""
from typing import Any, Dict, List, Tuple, Union
import numpy as np
class Model:
"""Model class."""
def __init__(
self,
model_name_or_path: str,
model_type: str,
cache_dir: str,
device: int,
use_accelerate: bool,
use_parallelize: boo... | manifest-main | manifest/api/models/model.py |
"""Huggingface model."""
import json
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import numpy as np
import PIL
import torch
from accelerate import dispatch_model, infer_auto_device_map
from accelerate.utils.modeling import get_max_memory as acc_get_max_memory
from transfor... | manifest-main | manifest/api/models/huggingface.py |
"""Serializer."""
import io
import json
import os
from pathlib import Path
from typing import Dict
import numpy as np
import xxhash
from manifest.caches.array_cache import ArrayCache
class Serializer:
"""Serializer."""
def request_to_key(self, request: Dict) -> str:
"""
Normalize a request... | manifest-main | manifest/caches/serializers.py |
"""Cache for queries and responses."""
from abc import ABC, abstractmethod
from typing import Any, Dict, Type, Union
from manifest.caches.serializers import ArraySerializer, NumpyByteSerializer, Serializer
from manifest.request import DiffusionRequest, EmbeddingRequest, LMRequest, Request
from manifest.response import... | manifest-main | manifest/caches/cache.py |
"""Cache init."""
| manifest-main | manifest/caches/__init__.py |
"""SQLite cache."""
import logging
from typing import Any, Dict, Union
from sqlitedict import SqliteDict
from manifest.caches.cache import Cache
logging.getLogger("sqlitedict").setLevel(logging.WARNING)
class SQLiteCache(Cache):
"""A SQLite cache for request/response pairs."""
def connect(self, connection... | manifest-main | manifest/caches/sqlite.py |
"""Redis cache."""
from typing import Any, Dict, Union
import redis
from manifest.caches.cache import Cache
class RedisCache(Cache):
"""A Redis cache for request/response pairs."""
def connect(self, connection_str: str, cache_args: Dict[str, Any]) -> None:
"""
Connect to client.
Ar... | manifest-main | manifest/caches/redis.py |
"""Noop cache."""
from typing import Any, Dict, Union
from manifest.caches.cache import Cache
class NoopCache(Cache):
"""A Noop cache that caches nothing for request/response pairs."""
def connect(self, connection_str: str, cache_args: Dict[str, Any]) -> None:
"""
Connect to client.
... | manifest-main | manifest/caches/noop.py |
"""Postgres cache."""
import hashlib
import logging
from typing import Any, Dict, Union
logger = logging.getLogger("postgresql")
logger.setLevel(logging.WARNING)
from ..caches.cache import Cache
try:
import sqlalchemy # type: ignore
from google.cloud.sql.connector import Connector # type: ignore
from s... | manifest-main | manifest/caches/postgres.py |
"""Array cache."""
from pathlib import Path
from typing import Union
import numpy as np
from sqlitedict import SqliteDict
def open_mmap_arr(file: Union[Path, str], size: float) -> np.memmap:
"""Open memmap."""
if not Path(file).exists():
mode = "w+"
else:
mode = "r+"
arr = np.memmap( ... | manifest-main | manifest/caches/array_cache.py |
"""Test client pool."""
import time
import pytest
from manifest.connections.client_pool import ClientConnection, ClientConnectionPool
from manifest.request import LMRequest
def test_init() -> None:
"""Test initialization."""
client_connection1 = ClientConnection(
client_name="openai", client_connec... | manifest-main | tests/test_client_pool.py |
"""Setup for all tests."""
import os
import shutil
from pathlib import Path
from typing import Generator
import numpy as np
import pytest
import redis
from manifest.request import DiffusionRequest, EmbeddingRequest, LMRequest
from manifest.response import ArrayModelChoice, LMModelChoice, ModelChoices
@pytest.fixtur... | manifest-main | tests/conftest.py |
"""Response test."""
from typing import List, cast
import numpy as np
import pytest
from manifest import Response
from manifest.request import EmbeddingRequest, LMRequest
from manifest.response import (
ArrayModelChoice,
LMModelChoice,
ModelChoices,
Usage,
Usages,
)
def test_init(
model_choi... | manifest-main | tests/test_response.py |
"""Request test."""
from manifest.request import DiffusionRequest, LMRequest
def test_llm_init() -> None:
"""Test request initialization."""
request = LMRequest()
assert request.temperature == 0.7
request = LMRequest(temperature=0.5)
assert request.temperature == 0.5
request = LMRequest(**{"... | manifest-main | tests/test_request.py |
"""Cache test."""
import json
import numpy as np
from manifest.caches.serializers import ArraySerializer, NumpyByteSerializer
def test_response_to_key_array() -> None:
"""Test array serializer initialization."""
serializer = ArraySerializer()
arr = np.random.rand(4, 4)
res = {"response": {"choices":... | manifest-main | tests/test_serializer.py |
"""Test scheduler."""
from manifest.connections.scheduler import RandomScheduler, RoundRobinScheduler
def test_random_scheduler() -> None:
"""Test random scheduler."""
scheduler = RandomScheduler(num_clients=2)
# Try 20 clients and make sure 0 and 1 are both
# returned
client_ids = set()
for ... | manifest-main | tests/test_scheduler.py |
"""Manifest test."""
import asyncio
import os
from typing import Iterator, cast
from unittest.mock import MagicMock, Mock, patch
import numpy as np
import pytest
import requests
from requests import HTTPError
from manifest import Manifest, Response
from manifest.caches.noop import NoopCache
from manifest.caches.sqlit... | manifest-main | tests/test_manifest.py |
"""Array cache test."""
from pathlib import Path
import numpy as np
import pytest
from manifest.caches.array_cache import ArrayCache
def test_init(tmpdir: Path) -> None:
"""Test cache initialization."""
cache = ArrayCache(Path(tmpdir))
assert (tmpdir / "hash2arrloc.sqlite").exists()
assert cache.cur... | manifest-main | tests/test_array_cache.py |
"""Test the HuggingFace API."""
import math
import os
from subprocess import PIPE, Popen
import numpy as np
import pytest
from manifest.api.models.huggingface import MODEL_REGISTRY, TextGenerationModel
from manifest.api.models.sentence_transformer import SentenceTransformerModel
NOCUDA = 0
try:
p = Popen(
... | manifest-main | tests/test_huggingface_api.py |
"""
Test client.
We just test the dummy client.
"""
from manifest.clients.dummy import DummyClient
def test_init() -> None:
"""Test client initialization."""
client = DummyClient(connection_str=None)
assert client.n == 1 # type: ignore
args = {"n": 3}
client = DummyClient(connection_str=None, c... | manifest-main | tests/test_client.py |
"""Cache test."""
from typing import Dict, Type, cast
import numpy as np
import pytest
from redis import Redis
from sqlitedict import SqliteDict
from manifest.caches.cache import Cache
from manifest.caches.noop import NoopCache
from manifest.caches.postgres import PostgresCache
from manifest.caches.redis import Redis... | manifest-main | tests/test_cache.py |
import asyncio
import time
from manifest import Manifest
def main():
manifest = Manifest(
client_name="openaichat",
)
print("Running in serial")
prompts = [f"Tell me something interesting about {i}" for i in range(50)]
st = time.time()
for pmt in prompts:
_ = manifest.run(pm... | manifest-main | examples/manifest_async.py |
import nltk
from nltk.corpus import wordnet as wn
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from scipy.sparse.csgraph import floyd_warshall, connected_components
import operator
from collections import defaultdict
import numpy as np
import networkx as nx
import json
from... | hyperE-master | preprocess/wordnet_preprocess.py |
# read from a list of artists and get albums and songs from musicbrainz
import argh
import urllib.request as req
import numpy as np
from xml.etree import ElementTree as ET
# songs will overlap in title:
def check_song_name(song_dict, song_name, idx):
sn = song_name
i = 1
while sn in song_dict:
i +=... | hyperE-master | preprocess/musicbrainz_preprocess.py |
import nltk
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from scipy.sparse.csgraph import floyd_warshall, connected_components
import operator
from collections import defaultdict
import numpy as np
import networkx as nx
import json
from collections import defaultdict
# So... | hyperE-master | preprocess/wikidata_preprocess.py |
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from autoencoder.autoencoder_models.Autoencoder import Autoencoder
mnist = input_data.read_data_sets('MNIST_data', one_hot = True)
def standard_scale(X_train, X_test):
prepr... | models-master | autoencoder/AutoencoderRunner.py |
models-master | autoencoder/__init__.py | |
import numpy as np
import tensorflow as tf
def xavier_init(fan_in, fan_out, constant = 1):
low = -constant * np.sqrt(6.0 / (fan_in + fan_out))
high = constant * np.sqrt(6.0 / (fan_in + fan_out))
return tf.random_uniform((fan_in, fan_out),
minval = low, maxval = high,
... | models-master | autoencoder/Utils.py |
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from autoencoder.autoencoder_models.DenoisingAutoencoder import AdditiveGaussianNoiseAutoencoder
mnist = input_data.read_data_sets('MNIST_data', one_hot = True)
def standard_sca... | models-master | autoencoder/AdditiveGaussianNoiseAutoencoderRunner.py |
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from autoencoder.autoencoder_models.VariationalAutoencoder import VariationalAutoencoder
mnist = input_data.read_data_sets('MNIST_data', one_hot = True)
def min_max_scale(X_tr... | models-master | autoencoder/VariationalAutoencoderRunner.py |
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from autoencoder.autoencoder_models.DenoisingAutoencoder import MaskingNoiseAutoencoder
mnist = input_data.read_data_sets('MNIST_data', one_hot = True)
def standard_scale(X_trai... | models-master | autoencoder/MaskingNoiseAutoencoderRunner.py |
import tensorflow as tf
import numpy as np
import autoencoder.Utils
class VariationalAutoencoder(object):
def __init__(self, n_input, n_hidden, optimizer = tf.train.AdamOptimizer()):
self.n_input = n_input
self.n_hidden = n_hidden
network_weights = self._initialize_weights()
self.... | models-master | autoencoder/autoencoder_models/VariationalAutoencoder.py |
models-master | autoencoder/autoencoder_models/__init__.py | |
import tensorflow as tf
import numpy as np
import autoencoder.Utils
class Autoencoder(object):
def __init__(self, n_input, n_hidden, transfer_function=tf.nn.softplus, optimizer = tf.train.AdamOptimizer()):
self.n_input = n_input
self.n_hidden = n_hidden
self.transfer = transfer_function
... | models-master | autoencoder/autoencoder_models/Autoencoder.py |
import tensorflow as tf
import numpy as np
import autoencoder.Utils
class AdditiveGaussianNoiseAutoencoder(object):
def __init__(self, n_input, n_hidden, transfer_function = tf.nn.softplus, optimizer = tf.train.AdamOptimizer(),
scale = 0.1):
self.n_input = n_input
self.n_hidden = ... | models-master | autoencoder/autoencoder_models/DenoisingAutoencoder.py |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | models-master | swivel/swivel.py |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | models-master | swivel/prep.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | swivel/vecs.py |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | models-master | swivel/wordsim.py |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | models-master | swivel/glove_to_shards.py |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | models-master | swivel/text2bin.py |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | models-master | swivel/nearest.py |
import tensorflow as tf
print("hi")
# Creates a graph.
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
print("consts")
c = tf.matmul(a, b)
# Creates a session with log_device_placement set to True.
print("create session")
se... | models-master | inception/GPU-test.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/imagenet_distributed_train.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/alexnet_model.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/imagenet_eval.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/imagenet_data.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/inception_distributed_train.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/flowers_train.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/imagenet_train.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/inception_train.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/dataset.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/alexnet_distributed_train.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/inception_model.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/flowers_data.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/inception_eval.py |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | models-master | inception/inception/compute_group_optimizer.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/image_processing.py |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | models-master | inception/inception/flowers_eval.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.