並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 30 件 / 30件

新着順 人気順

python check if not isinstanceの検索結果1 - 30 件 / 30件

  • OpenAI API の ファインチューニングガイド|npaka

    1. ファインチューニングの利点ファインチューニングの利点は、次のとおりです。 (1) プロンプトよりも高品質な応答 (2) プロンプトに収まりきらないより多くの例の適用 (3) プロンプトの短縮によるトークン数 (コスト) の節約 (4) プロンプトの短縮による処理時間の短縮 モデルは膨大な量のテキストで事前学習されており、このモデルを効果的に利用するため、プロンプトに手順や応答の例を指定する手法が使われます。この例を使用してタスクの実行方法を示すことを「Few-Shot」と呼びます。 ファインチューニングで、プロンプトに収まりきらないより多くの例で学習することにより、さまざまなタスクでより良い結果を達成できるようになります。プロンプトに多くの例を指定する必要はなくなります。これによりトークン (コスト) が節約され、処理時間も短縮されます。 2. ファインチューニングの使用料金ファイン

      OpenAI API の ファインチューニングガイド|npaka
    • GPT in 60 Lines of NumPy | Jay Mody

      January 30, 2023 In this post, we'll implement a GPT from scratch in just 60 lines of numpy. We'll then load the trained GPT-2 model weights released by OpenAI into our implementation and generate some text. Note: This post assumes familiarity with Python, NumPy, and some basic experience with neural networks. This implementation is for educational purposes, so it's missing lots of features/improv

      • Writing a C compiler in 500 lines of Python

        A few months ago, I set myself the challenge of writing a C compiler in 500 lines of Python1, after writing my SDF donut post. How hard could it be? The answer was, pretty hard, even when dropping quite a few features. But it was also pretty interesting, and the result is surprisingly functional and not too hard to understand! There's too much code for me to comprehensively cover in a single blog

        • 型安全かつシンプルなAgentフレームワーク「PydanticAI」の実装を解剖する - ABEJA Tech Blog

          はじめに こちらはABEJAアドベントカレンダー2024 12日目の記事です。 こんにちは、ABEJAでデータサイエンティストをしている坂元です。最近はLLMでアプローチしようとしていたことがよくよく検証してみるとLLMでは難しいことが分かり急遽CVのあらゆるモデルとレガシーな画像処理をこれでもかというくらい詰め込んだパイプラインを実装することになった案件を経験して、LLMでは難しそうなことをLLM以外のアプローチでこなせるだけの引き出しとスキルはDSとしてやはり身に付けておくべきだなと思うなどしています(LLMにやらせようとしていることは大抵難しいことなので切り替えはそこそこ大変)。 とはいうものの、Agentの普及によってより複雑かつ高度な推論も出来るようになってきています。弊社の社内外のプロジェクト状況を見ていても最近では単純なRAG案件は減りつつあり、計画からアクションの実行、結果

            型安全かつシンプルなAgentフレームワーク「PydanticAI」の実装を解剖する - ABEJA Tech Blog
          • データ検証ライブラリPydanticの紹介 | gihyo.jp

            寺田 学(@terapyon)です。2025年10月の「Python Monthly Topics」は、データ検証ライブラリのPydanticを紹介します。 型安全とデータ構造 主題のPydanticの説明に入る前に、Pythonにおける型安全の考え方とデータ構造についておさらいしておきます。 型安全のための型ヒント Pythonは動的型付け言語です。型を宣言せずにコーディングすることができますが、型ヒントを書くことで型安全にコーディングできます。最近のPythonコードには型ヒントが書かれていることが多くなっているかと思います。 本連載(Python Monthly Topics)でも過去に型ヒント関係のトピックを扱っていますので、参照してください。 2022年9月:Python最新バージョン対応!より良い型ヒントの書き方 2024年11月:Python型ヒントの動向と新しい機能の紹介

              データ検証ライブラリPydanticの紹介 | gihyo.jp
            • 複数の AWS アカウントの AWS Security Hub 検出結果を Google BigQuery と Google DataPortal(DataStudio) により可視化した話 - Adwaysエンジニアブログ

              こんにちは、インフラの天津です。今日は 複数アカウントの AWS Security Hub 検出結果の可視化についてお話したいと思います。 前提 モチベーション AWS Security Hub とは 構想 ツール・サービスの選定 検出結果データのエクスポートについて 可視化用データベース(またはクエリサービス)と可視化ツールについて 構築 全体像 検出結果データエクスポート 検出結果データの S3 -> GCS への転送と BigQuery へのインポート Security Hub からエクスポートしたデータには BigQuery のカラム名に使用できない文字(以下禁則文字)が使用されている件 自動判別で生成されたスキーマでインポートした際に INTEGER 型のカラムに STRING 型のデータが入ってくることがありインポートエラーが発生する件 AWS アカウントデータの S3 ->

                複数の AWS アカウントの AWS Security Hub 検出結果を Google BigQuery と Google DataPortal(DataStudio) により可視化した話 - Adwaysエンジニアブログ
              • SuperwhisperとVSCodeのCopilot Agentを使って、音声から素早くブログを書き上げる - yasuhisa's blog

                3行まとめ アウトプットの速度を上げたいが、記事を書くのは時間がかかる SuperwhisperとVSCodeのCopilot Agentを組み合せて、音声からブログを書き上げるワークフローを組んだ 実際に使っているpromptを含め、真似しやすいように詳しく紹介 3行まとめ 背景: アウトプット速度を上げたい & LLMの急速な進化 利用している技術 Superwhisper: 技術用語も認識する書き起しアプリ VSCode Copilot Agent: 自然言語で校正のワークフローを組み込む 実用例: どれくらい早くアウトプットできるようになるか 実際のワークフロー 工夫した点 過去に自分が執筆したテキストの資産を活用する 依存関係の抽出を自動で行なう 複数のAgentにレビューをさせる タイトル案の自動生成 実装を通して得られた学び 自然言語でワークフローを組み立てることの難しさ エ

                  SuperwhisperとVSCodeのCopilot Agentを使って、音声から素早くブログを書き上げる - yasuhisa's blog
                • mypy plugin に入門して社内 OSS である gokart を型安全にしてみた - エムスリーテックブログ

                  今回は mypy plugin を利用して、型安全に対応していないライブラリを型安全にする方法を紹介します! 具体的にはエムスリーが開発する機械学習パイプラインツールである gokart を対象とし、mypy plugin を用いてどのように型の課題を解消したかについて解説します。 対象読者としては、既に gokart を使ってくださっている方はもちろんですが、dataclass や Pydantic がどのように型を担保しているかについて興味がある方も想定しています。 github.com gokart について gokart における型の問題 クラス変数をハックするツールである mypy による型チェックする上での課題 mypy plugin を自作してみる 静的解析時のイベントにフックする Plugin クラス 構文解析の結果を上書きする mypy API mypy plugin 開

                    mypy plugin に入門して社内 OSS である gokart を型安全にしてみた - エムスリーテックブログ
                  • Hypothesisとpytestを使ってDjangoのユニットテストを書く - 何かを書き留める何か

                    Hypothesisとは何か、プロパティベーステストとは何か Hypothesisは、Python向けのプロパティベーステストのライブラリである。 プロパティベーステストは、生成された多数の入力データに対してプロパティ(性質)が満たされるかどうかをテストする手法である。 HaskellのQuickCheckライブラリが初出で、現在は各プログラミング言語に移植されている。 従来のユニットテストは、ある程度固定したテストデータを指定してテストを行っていた。 その際、境界値分析などで妥当なパラメータを決定していた。 しかし、境界値分析が必ず通用するとは限らないし、人間が行う以上、ミスも発生する。 プロパティベーステストはデータを固定する代わりにそのデータが満たすプロパティを指定してテストを行う。 実際のテストケースはHypothesisがプロパティを満たすパラメータを決めて生成してくれる。 人力

                      Hypothesisとpytestを使ってDjangoのユニットテストを書く - 何かを書き留める何か
                    • Implementing Logic Programming

                      Most of my readers are probably familiar with procedural programming, object-oriented programming (OOP), and functional programming (FP). The majority of top programming languages on all of the language popularity charts (like TIOBE) support all three to some extent. Even if a programmer avoided one or more of those three paradigms like the plague, they’re likely at least aware of them and what th

                        Implementing Logic Programming
                      • Python's "Type Hints" are a bit of a disappointment to me

                        blog - git - desktop - images - contact Python's "Type Hints" are a bit of a disappointment to me 2022-04-21 Preface You are reading version 2.0 of this blog post. I've incorporated some feedback I got into this revised version. Introduction Over the course of several Python 3.x versions, "type hints" were introduced. You can now annotate functions: def greeting(name: str) -> str: return 'Hello '

                        • Why I use attrs instead of pydantic

                          This post is an account of why I prefer using the attrs library over Pydantic. I'm writing it since I am often asked this question and I want to have something concrete to link to. This is not meant to be an objective comparison of attrs and Pydantic; I'm not interested in comparing bullet points of features, nor can I be unbiased since I'm a major contributor to attrs (at time of writing, second

                          • Solving Quantitative Reasoning Problems With Language Models

                            Solving Quantitative Reasoning Problems with Language Models Aitor Lewkowycz∗, Anders Andreassen†, David Dohan†, Ethan Dyer†, Henryk Michalewski†, Vinay Ramasesh†, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur∗, Guy Gur-Ari∗, and Vedant Misra∗ Google Research Abstract Language models have achieved remarkable performance on a wide range of tasks that require

                            • NIST SP800-171へ準拠することが決まったら 〜 FIPSモードを有効化した場合

                              ヤフー株式会社は、2023年10月1日にLINEヤフー株式会社になりました。LINEヤフー株式会社の新しいブログはこちらです。LINEヤフー Tech Blog ヤフーの IaaS チームに所属する木下です。普段はインフラエンジニアとして IaaS 基盤の開発・構築・運用を担当しています。 ヤフーを傘下に持つZホールディングスは、高度化するサイバーセキュリティの脅威に対応するため、サイバーセキュリティ基本方針を掲げています。 この基本方針の中で、Zホールディングスおよびそのグループ企業は、米国標準技術研究所(NIST)が定めたサイバーセキュリティ基準に準拠したシステムを構築し、サービスを提供すると宣言しています。 タイトルにある NIST SP800-171 はこの「米国標準技術研究所(NIST)が定めたサイバーセキュリティ基準」の一例です。 私が担当する IaaS 基盤でも、このサイバー

                                NIST SP800-171へ準拠することが決まったら 〜 FIPSモードを有効化した場合
                              • davepeck.org

                                Template strings, also known as t-strings, have been officially accepted as a feature in Python 3.14, which will ship in late 2025. 🎉 I'm excited; t-strings open the door to safer more flexible string processing in Python. What's the big idea with t-strings? Since they were introduced in Python 3.6, f-strings have become a very popular way to format strings. They are concise, readable, and powerf

                                • [Ansible] そのtag設定、想定通りに動いてますか? (継承機能とその実装を確認する) - zaki work log

                                  playbook内のtask定義にtagを設定しておくことで、指定tagのtaskのみ実行したり、逆に指定tagのtaskを除外してansible-playbookを実行することができます。 開発中のtaskのみピンポイントで実行したい場合や、逆に、共有のDBのデータを更新したりするtaskはほかのユーザーやチームと調整してからでないと実行が難しかったり、Blue-Greenデプロイメントの実装で環境Aの機能をオフにしてもう片方の環境Bをオンにするような処理だけど開発中は環境Bだけ確認したかったり、大量データのダウンロードや冪等の確認を伴い処理に時間がかかるため開発中は実行したくないなど特定のtaskは実行したくない場合に利用できます。 また、特殊tagとして、常に実行するalwaysと実行しないneverというtagが予約語として用意されています。 neverは特に「通常は実行したくない

                                    [Ansible] そのtag設定、想定通りに動いてますか? (継承機能とその実装を確認する) - zaki work log
                                  • Vim9 script for Python Developers · GitHub

                                    vim9script4pythondevelopers.md Vim9 script for Python Developers Vim9 script�Vim script��������������������������������������������������系��� def������義����������Vim script��vim9script�����使����������(vim9script���

                                      Vim9 script for Python Developers · GitHub
                                    • Gregory Szorc's Digital Home | Rust is for Professionals

                                      A professional programmer delivers value through the authoring and maintaining of software that solves problems. (There are other important ways for professional programmers to deliver value but this post is about programming.) Programmers rely on various tools to author software. Arguably the most important and consequential choice of tool is the programming language. In this post, I will articul

                                      • Python behind the scenes #11: how the Python import system works

                                        If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like ImportError: attempted relative import with no known parent package; or tried to figure out how to structure a project so that all the imports work correctly; or hacked sys.path when you couldn

                                        • A from-scratch tour of Bitcoin in Python

                                          I find blockchain fascinating because it extends open source software development to open source + state. This seems to be a genuine/exciting innovation in computing paradigms; We don’t just get to share code, we get to share a running computer, and anyone anywhere can use it in an open and permissionless manner. The seeds of this revolution arguably began with Bitcoin, so I became curious to dril

                                          • Accelerating Generative AI with PyTorch: Segment Anything, Fast – PyTorch

                                            Blog Accelerating Generative AI with PyTorch: Segment Anything, Fast This post is the first part of a multi-series blog focused on how to accelerate generative AI models with pure, native PyTorch. We are excited to share a breadth of newly released PyTorch performance features alongside practical examples of how these features can be combined to see how far we can push PyTorch native performance.

                                              Accelerating Generative AI with PyTorch: Segment Anything, Fast – PyTorch
                                            • Django Rest Frameworkの処理メモ - Atsuo Ishimoto's blog

                                              Django Rest Framework、使うたびに中を開けて同じことを調べているので、内部の主要なメソッドのメモを残す。 ViewSetMixin¶ class ViewSetMixin: request: args = args kwargs = kwargs action:Literal["list", "create", "get", "update", "partial_update", "destroy"] class ModelViewSet: def get_serializer_context(self): return { 'request': self.request, 'format': self.format_kwarg, 'view': self } def get_serializer(self, *args, **kwargs): serializer_c

                                                Django Rest Frameworkの処理メモ - Atsuo Ishimoto's blog
                                              • Decorator JITs - Python as a DSL - Eli Bendersky's website

                                                Spend enough time looking at Python programs and packages for machine learning, and you'll notice that the "JIT decorator" pattern is pretty popular. For example, this JAX snippet: import jax.numpy as jnp import jax @jax.jit def add(a, b): return jnp.add(a, b) # Use "add" as a regular Python function ... = add(...) Or the Triton language for writing GPU kernels directly in Python: import triton im

                                                • Exhaustive Union Matching in Python - Preferred Networks Research & Development

                                                  Pattern matching on algebraic data types is a powerful technique to process a given input and many programming languages have adopted it in one way or another. A check on whether a given match is “exhaustive”, i.e., covers all possible inputs, is helpful to avoid bugs when the set of possible inputs is extended; for example, when new enumeration values are added. In this blog post I will first bri

                                                    Exhaustive Union Matching in Python - Preferred Networks Research & Development
                                                  • Pandas DataFrame Visualization Tools - Practical Business Python

                                                    Introduction I have talked quite a bit about how pandas is a great alternative to Excel for many tasks. One of Excel’s benefits is that it offers an intuitive and powerful graphical interface for viewing your data. In contrast, pandas + a Jupyter notebook offers a lot of programmatic power but limited abilities to graphically display and manipulate a DataFrame view. There are several tools in the

                                                      Pandas DataFrame Visualization Tools - Practical Business Python
                                                    • 【後編】ChatGPTでロボットコード「PythonRobotics」を解読できるのか? - Qiita

                                                      はじめに 基盤モデル×RoboticsのAdventCalendarの4日目です! カレンダーものぞいてみてくださいー!(私は計3投稿目らしい笑) https://qiita.com/advent-calendar/2022/robot-ai 一日目に基盤モデルのお話を書いてますので、ぜひ! 【🎉基盤モデル×Robotics 1日目 投稿🎉】 タイトル:基盤モデルとは 東京大学 松尾研究室が主催する「基盤モデル×Robotics」に関するAdvent Calendarの1日目を投稿しました! リンクのカレンダー(12/1)から記事を是非読んでください🎄#拡散希望RT #adventcalendar2022 https://t.co/mcTe4RAEMD — るっと🐨 Ph.D. 🤖 (@MeRTcooking) December 1, 2022 拡散RT&いいね何卒です(モチベあ

                                                        【後編】ChatGPTでロボットコード「PythonRobotics」を解読できるのか? - Qiita
                                                      • Build and deploy ML inference applications from scratch using Amazon SageMaker | Amazon Web Services

                                                        Artificial Intelligence Build and deploy ML inference applications from scratch using Amazon SageMaker As machine learning (ML) goes mainstream and gains wider adoption, ML-powered inference applications are becoming increasingly common to solve a range of complex business problems. The solution to these complex business problems often requires using multiple ML models and steps. This post shows y

                                                          Build and deploy ML inference applications from scratch using Amazon SageMaker | Amazon Web Services
                                                        • EXP-301受講記 & OSED合格記 - プログラム系統備忘録ブログ

                                                          OffSec社のEXP-301コースを受講し、OSED試験に合格できました。コースや試験の概要、これから取り組む方へのアドバイス、備忘録等の記事です。 なお、レポート作成方法はPEN-200-2022受講記 & OSCP合格記の時とほぼ同じです。よろしければそちらの記事もご参照ください。 分かる人向けの結果概要 EXP-301コースとは サポート関係 IDAの逆コンパイル機能は使えないので注意 Lab環境のWinDbgバージョンが古くて一部辛い 私の事前知識 EXP-301コース受講記 OSED試験受験記 OSED試験の申込み 試験の準備 OSED試験本番 合格通知 感想 おまけ: 検証用コードの紹介 bad Characters確認用コード ROPチェーン構築用クラス 分かる人向けの結果概要 EXP-301コース関連に合計210時間ほど取り組みました。 ExerciseやExtra Mi

                                                            EXP-301受講記 & OSED合格記 - プログラム系統備忘録ブログ
                                                          • Ruff: a fast Python linter

                                                            May 2, 2023 This article was contributed by Koen Vervloesem Linters are tools that analyze a program's source code to detect various problems such as syntax errors, programming mistakes, style violations, and more. They are important for maintaining code quality and readability in a project, as well as for catching bugs early in the development cycle. Last year, a new Python linter appeared: Ruff.

                                                            • AI Agent用フレームワーク「Dapr Agents」について調べてみた | フューチャー技術ブログ

                                                              Today, we are excited to announce Dapr Agents, a framework built on top of Dapr that combines stateful workflow coordination with advanced Agentic AI features. 本日、Dapr を基盤として構築された新たなフレームワーク「Dapr Agents」のリリースを発表いたします。Dapr Agents は、ステートフルなワークフロー調整機能と先進的な Agentic AI 機能を統合したソリューションです。 https://www.cncf.io/blog/2025/03/12/announcing-dapr-ai-agents/ CNCF 連載 6 日目はDapr Agentsの検討記事です。 Dapr Agents の技術的背景や意義を

                                                              1